<!DOCTYPE html>
<html>
<head>
    <title></title>

    <script type="text/javascript">
        // First, parse the query string
        var params = {}, queryString = location.hash.substring(1),
                regex = /([^&=]+)=([^&]*)/g, m;
        while (m = regex.exec(queryString)) {
            params[decodeURIComponent(m[1])] = decodeURIComponent(m[2]);
        }

        // And send the token over to the server
        var req = new XMLHttpRequest();
        // consider using POST so query isn't logged
        req.open('GET', 'https://' + window.location.host + '/catchtoken?' + queryString, true);
        window.location = params['state'];


    </script>

</head>
<body>

</body>
</html>